{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Thanks for your interest in MCOS. This notebook has everything you will need to test and run the MCOS library. \n",
    "# For full information on how to use this library, please visit https://github.com/enjine-com/mcos\n",
    "# \n",
    "# \n",
    "# Prior to running this notebook, please install the MOCS library, and matlabplot\n",
    "# \n",
    "# pip install mcos\n",
    "# pip install matplotlib\n",
    "# \n",
    "# Thanks!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                 mean     stdev\n",
      "optimizer                      \n",
      "HRP          0.054100  0.039954\n",
      "markowitz    0.020253  0.016700\n",
      "NCO         -0.066727  0.360630\n",
      "Risk Parity -0.002904  0.011159\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2f4de6ac550>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAExCAYAAABs9lmMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAY+klEQVR4nO3df7jWdZ3n8eebo0SY2gTogkSHSU0JSAlQEn9QjuY6SU5eoatbaeXVGJW6dmU7Odm409bozLimybKNP8bJtdyyKClXWtwUzRAlSU1lFfUMTiElkqaCvPeP+wZvTud4ft3nfLk/PB/XdV/e35/nfe6L8/Jzf76f7+cbmYkkqfUNq7oASVJzGOiSVAgDXZIKYaBLUiEMdEkqhIEuSYXYpaofPHr06Gxvb6/qx0tSS1qxYsUzmTmmq22VBXp7ezv33HNPVT9eklpSRDzR3Ta7XCSpEAa6JBXCQJekQlTWhy5JPdm0aRMdHR28+OKLVZcy5EaMGMH48ePZdddde32MgS5ph9XR0cHuu+9Oe3s7EVF1OUMmM1m/fj0dHR1MnDix18fZ5SJph/Xiiy8yatSonSrMASKCUaNG9fmbiYEuaYe2s4X5Vv35ve1ykVrVhXsOwjk3NP+cGjIGuqSW0X7+zU0935qvHN/U81XNLhdJeg1r1qzhgAMO4GMf+xiTJ0/m1FNPZcmSJRx22GHst99+/PznP+f555/njDPOYMaMGRx88MF8//vf33bs4YcfzrRp05g2bRp33nknALfddhtHHXUUJ510EgcccACnnnoqzXh6nC10SerB6tWrufHGG1m4cCEzZszg+uuv54477mDRokV8+ctfZtKkSbz73e/mqquu4tlnn2XmzJkcffTR7LXXXtx6662MGDGCRx99lFNOOWXblCf33XcfDzzwAOPGjeOwww5j2bJlzJ49e0B1GuiS1IOJEycyZcoUAN7+9rfznve8h4hgypQprFmzho6ODhYtWsQll1wC1EbnPPnkk4wbN4758+ezcuVK2traeOSRR7adc+bMmYwfPx6Agw46iDVr1hjokjTYXve61217P2zYsG3Lw4YNY/PmzbS1tfGd73yHt73tbdsdd+GFF7L33nvzi1/8gi1btjBixIguz9nW1sbmzZsHXKd96JI0QMceeyxf+9rXtvWD33fffQBs2LCBsWPHMmzYMK677jpeeeWVQa3DQJekAbrgggvYtGkTU6dOZfLkyVxwwQUAnHXWWVx77bUceuihPPLII+y2226DWkc048pqf0yfPj2dD10agJ1gHPpDDz3EgQceWHUZlenq94+IFZk5vav9baFLUiEMdEkqhIEuSYUw0CWpEAa6JBXCQJekQhjoktQHl156KS+88EKX26655hrmz58/xBW9ylv/JbWOZo+978e4+0svvZTTTjuNkSNHNreWJrCFLkndeP755zn++ON5xzveweTJk/nSl77E2rVrmTNnDnPmzAHg6quvZv/99+fII49k2bJl245dt24dH/jAB5gxYwYzZsxg2bJlbNmyhfb2dp599tlt++277778+te/bkq9ttAlqRs//vGPGTduHDffXHuwxoYNG7j66qtZunQpo0eP5umnn+aLX/wiK1asYM8992TOnDkcfPDBAHz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jfFX1U2gkY6GpZEfFOavPEHAIcCnyc2m3cbwMW1m9ceg44KzMvA9YCczJzThen2xf4b8BUavPO/AdqN0SdB/znzjtn5kGZeRBwAXAPcCe1Od//T2bOoPbs1IsjYrf6IbOAD2emj97ToDHQ1cpmAzdl5vOZ+Xtqk30dDjyVmcvq+/xLfb+ePJ6ZqzJzC/AA8JOs9UeuAtq7OiAi9gMuBuZl5ibgGOD8iFgJ3AaMACbUd781M3/bj99R6jVv/Vcri27Wd74w1JsLRS81vN/SsLyFLv5O6i3vbwMfz8y1DfV8IDMf7rTvIbx6Z6I0aGyhq5X9FHh/vY98N+BE4HZgQkTMqu9zCnBH/f1GYPcm/eyrgasz8/aGdbcAn4qIAIiIg5v0s6ReMdDVsjLzXuAa4OfA3cA3qE2L+hC1ycDuB94EXFk/ZCHwo60XRfurPjfNScAZDRdGpwMXUZvz/f6I+GV9WRoyDltUUSKiHfhhZk6uuBRpyNlCl6RC2EKXpELYQpekQhjoklQIA12SCmGgS1IhDHRJKoSBLkmF+P+7eGfXgsTeyQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "from mcos import optimizer\n",
    "from mcos import observation_simulator\n",
    "from mcos import mcos\n",
    "from mcos.error_estimator import ExpectedOutcomeErrorEstimator, SharpeRatioErrorEstimator, \\\n",
    "    VarianceErrorEstimator\n",
    "from mcos.covariance_transformer import DeNoiserCovarianceTransformer, AbstractCovarianceTransformer\n",
    "from mcos.observation_simulator import AbstractObservationSimulator, MuCovLedoitWolfObservationSimulator, \\\n",
    "MuCovObservationSimulator\n",
    "from pypfopt.expected_returns import mean_historical_return\n",
    "from pypfopt.risk_models import sample_cov\n",
    "\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "\n",
    "# Create dataframe of price history to use for expected returns and covariance\n",
    "def prices_df() -> pd.DataFrame:\n",
    "    tickers = ['goog','baba', 'amzn', 'wmt', 'glpi', 'bac', 'uaa', 'shld', 'jpm', 'sbux', 'amd', 'aapl','bby',\n",
    "              'ge', 'rrc', 'ma','fb']\n",
    "    total_df = pd.DataFrame()\n",
    "    for id in tickers:\n",
    "        temp = pd.read_csv( id + '.us.txt', parse_dates=True, index_col='Date')\n",
    "        temp = pd.DataFrame(temp['Close']).rename(columns={\"Close\":id})\n",
    "        if total_df.empty:\n",
    "            total_df = temp\n",
    "        else:\n",
    "            total_df = total_df.join(temp)\n",
    "\n",
    "    return total_df\n",
    "\n",
    "# Choose the number of simulations to run\n",
    "num_sims = 50\n",
    "\n",
    "# Select the optimizers that you would like to compare\n",
    "op = [optimizer.HRPOptimizer(), optimizer.MarkowitzOptimizer(),optimizer.NCOOptimizer(), optimizer.RiskParityOptimizer()]\n",
    "\n",
    "# select the metric to use for comparison\n",
    "ee = ExpectedOutcomeErrorEstimator()\n",
    "\n",
    "# select your optional covariance transformer\n",
    "cov_trans = DeNoiserCovarianceTransformer()\n",
    "\n",
    "# convert price history to expected returns and covariance matrix\n",
    "mu = mean_historical_return(prices_df()).values\n",
    "cov = sample_cov(prices_df()).values\n",
    "\n",
    "# select your observational simulator\n",
    "obs_sim = MuCovObservationSimulator(mu, cov, num_sims)\n",
    "\n",
    "# Run the simulation\n",
    "results = mcos.simulate_optimizations(obs_sim, num_sims, op, ee, [cov_trans])\n",
    "print(results)\n",
    "results.plot.bar()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                 mean     stdev\n",
      "optimizer                      \n",
      "HRP          0.004639  0.002122\n",
      "markowitz    0.004266  0.001855\n",
      "NCO          0.045889  0.035224\n",
      "Risk Parity  0.000273  0.000224\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2f4de65f2e8>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAExCAYAAAByP2k/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAawUlEQVR4nO3df5RU5Z3n8feHFmwxiBNAD4ixmYg/CCggIEQ0oB4VjRInngDRNdEkHEdJ/DFm1Zm4wc2MmxmdDEt0YJkE/BEdEldNiJK4koVVUVFAAiJRexW1AxuRjEggKsh3/6gLlm0Dt6urudTD53VOHeve+9yqb9WxPzx173Ofq4jAzMzS1aHoAszMrH056M3MEuegNzNLnIPezCxxDnozs8Q56M3MErdf0QW0pHv37tHQ0FB0GWZmNWPJkiVvRUSPlrbtlUHf0NDA4sWLiy7DzKxmSHptZ9t86MbMLHEOejOzxDnozcwSt1ceozcz25UtW7bQ1NTEu+++W3Qpe1x9fT29e/emY8eOufdx0JtZzWlqaqJLly40NDQgqehy9piIYP369TQ1NdGnT5/c+/nQjZnVnHfffZdu3brtUyEPIIlu3bq1+peMg97MatK+FvLbVfK5HfRmZonzMXqzgjVc/3DVX3P198+p+mvuzar9Hab2/blHb2ZWgdWrV3PMMcfw9a9/nf79+3PhhRcyb948TjrpJPr27cszzzzDpk2buPTSSxk6dCiDBg3iF7/4xY59Tz75ZAYPHszgwYN58sknAViwYAGjRo3iggsu4JhjjuHCCy+kGncBdI/ezKxCjY2N3HfffcyYMYOhQ4dy77338sQTTzBnzhxuvvlm+vXrx6mnnsrMmTN5++23GTZsGKeffjqHHHIIjz76KPX19bz88stMmDBhx7Qvzz33HCtXrqRXr16cdNJJLFy4kJEjR7apTge9mVmF+vTpw4ABAwD4zGc+w2mnnYYkBgwYwOrVq2lqamLOnDnceuutQGm00Ouvv06vXr2YNGkSy5Yto66ujpdeemnHaw4bNozevXsDMHDgQFavXu2gNzMryv7777/jeYcOHXYsd+jQga1bt1JXV8f999/P0Ucf/ZH9Jk+ezKGHHspvf/tbtm3bRn19fYuvWVdXx9atW9tcp4/Rm5m1kzPPPJMf/vCHO46zP/fccwBs2LCBnj170qFDB+6++24++OCDdq3DQW9m1k5uvPFGtmzZwnHHHUf//v258cYbAbj88su58847GT58OC+99BIHHnhgu9ahapzRrbYhQ4aE56O3fYWHV7beqlWrOPbYY4suozAtfX5JSyJiSEvt3aM3M0ucg97MLHEOejOzxDnozcwS56A3M0ucg97MLHEOejOzKpkyZQqbN29ucdsdd9zBpEmT9nBFJZ4Cwcxq3+SuVX69DRXtNmXKFC666CI6d+5c3XrayD16M7MKbNq0iXPOOYfjjz+e/v37c9NNN7FmzRpGjx7N6NGjAZg1axZHHXUUn/vc51i4cOGOfdetW8cXv/hFhg4dytChQ1m4cCHbtm2joaGBt99+e0e7I488kj/84Q9trtU9ejOzCvz617+mV69ePPxw6crmDRs2MGvWLObPn0/37t1Zu3Yt3/3ud1myZAldu3Zl9OjRDBo0CIArr7ySq6++mpEjR/L6669z5plnsmrVKsaOHcuDDz7IJZdcwqJFi2hoaODQQw9tc63u0ZuZVWDAgAHMmzeP6667jscff5yuXT96+GjRokWMGjWKHj160KlTJ8aNG7dj27x585g0aRIDBw7kvPPO45133mHjxo2MGzeOn/70pwDMnj37I/u0hXv0ZmYVOOqoo1iyZAlz587lhhtu4IwzzvhYm53dyHvbtm089dRTHHDAAR9ZP2LECBobG1m3bh0///nP+c53vlOVWt2jNzOrwJo1a+jcuTMXXXQR1157LUuXLqVLly5s3LgRgBNPPJEFCxawfv16tmzZwn333bdj3zPOOIPbbrttx/KyZcuA0j8M559/Ptdccw3HHnss3bp1q0qt7tGbmVVgxYoVfPvb36ZDhw507NiRadOm8dRTTzFmzBh69uzJ/PnzmTx5MiNGjKBnz54MHjx4x7zzU6dO5YorruC4445j69atnHLKKUyfPh2AcePGMXToUO64446q1eppis0K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VnXv0liRJ10h6PntcJalB0u8k3SlpeXav2s6SvgX0AuZLmp/tu1pS97J9fpS9zj2STpe0UNLLkoZl7b8q6bbs+bKyx58lfU7SgZJmSnpW0nOSxpbtd5+kXwL/q6CvyvYBDnpLjqQTKM2jcyIwHPgGpUvZjwZmZBdkvQNcHhFTgTXA6IgY3cLLHQn8d+A4SvPyfJnShV7XAn/bvHFEDIyIgcCNwGLgSUpz7v/viBhK6d64t0g6MNtlBPCViPAtFK3dOOgtRSOBByNiU0T8idIkaScDb0TEwqzNT7J2u/NqRKyIiG3ASuA3UTreuQJoaGkHSX2BW4BxEbEFOAO4XtIyYAFQD3wqa/5oRPyxgs9olpunQLAUaSfrm5+QynOC6r2y59vKlrfRwt9P1lP/GfCNiFhTVs8XI+LFZm1P5MOrMM3ajXv0lqLHgC9kx+APBM4HHgc+JWlE1mYC8ET2fCPQpUrvPQuYFRGPl617BPimJAFIGlSl9zLLxUFvyYmIpcAdwDPAIuBHlKaeXUVpErXlwCeBadkuM4BfbT8ZW6ls7p4LgEvLTsgOAb5Hac795ZKez5bN9hgPr7R9gqQG4KGI6F9wKWZ7nHv0ZmaJc4/ezCxx7tGbmSXOQW9mljgHvZlZ4hz0ZmaJc9CbmSXOQW9mlrj/D+vAJldz0CmkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ee = VarianceErrorEstimator()\n",
    "results = mcos.simulate_optimizations(obs_sim, num_sims, op, ee, [cov_trans])\n",
    "print(results)\n",
    "results.plot.bar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                 mean     stdev\n",
      "optimizer                      \n",
      "HRP          0.823336  0.396339\n",
      "markowitz    0.457998  0.336647\n",
      "NCO          0.296357  1.300468\n",
      "Risk Parity -0.122985  0.772149\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2f4de529278>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAExCAYAAABs9lmMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAbqUlEQVR4nO3df5xVdb3v8debERsxtILRB4g0nMSUABUHlNSE9KqkRp58pKTHwoxHRynTaw/pnkzKe7p2tHM8psnlegCzjHu8alKiXu3iMfFHgJKIHnWuIk54EymRA5kgn/vHXuBmN8PsmVl7FvvL+/l47Id7rfXdaz7sh7z5znd913cpIjAzs/rXp+gCzMwsHw50M7NEONDNzBLhQDczS4QD3cwsEQ50M7NE7FHUDx44cGA0NzcX9ePNzOrSsmXL3oiIpvaOFRbozc3NLF26tKgfb2ZWlyS90tExD7mYmSXCgW5mlggHuplZIgobQzcz68zmzZtpa2vj7bffLrqUXtfY2MiQIUPo27dv1Z9xoJvZLqutrY3+/fvT3NyMpKLL6TURwbp162hra2PYsGFVf85DLma2y3r77bcZMGDAbhXmAJIYMGBAl38zcaCb2S5tdwvzbbrz5/aQi1m9mrlvDc65Pv9zWq9xoJtZ3WiecU+u51t19am5nq9oHnIxM9uJVatWccghh3DBBRcwcuRIzjnnHB588EGOOeYYhg8fzm9+8xs2btzI+eefz9ixYzniiCO4++67t3/2uOOOY8yYMYwZM4ZHH30UgIceeogJEyZw5plncsghh3DOOeeQx9Pj3EM3M+tEa2srt99+O7Nnz2bs2LHcdtttPPLIIyxYsIDvfe97jBgxgk9+8pPMmTOHN998k3HjxnHiiSey33778cADD9DY2MiLL77IlClTti958tRTT7Fy5UoGDx7MMcccw+LFizn22GN7VKcD3cysE8OGDWP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432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ee = SharpeRatioErrorEstimator()\n",
    "results = mcos.simulate_optimizations(obs_sim, num_sims, op, ee, [cov_trans])\n",
    "print(results)\n",
    "results.plot.bar()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
